<style type="text/css">
table.addt {padding:5px;background:#F5F5F5;border:1px dotted #F0F0F0;}
table.addt:hover {background:#F2F2F2;border:1px dotted #d9d9d9;}
div.expld {padding:5px;margin-bottom:10px;background:#fffff0;border:1px dotted #e5dd83;}
div.expld:hover {background:#ffffe5;border:1px dotted #e5db6c;} 
</style>
<div class="wrap">
<h2><?php _e("cBlogger Robot Manage Queue","cbrobot") ?></h2>
		<div style="width:100%;">		
				<form method="post" action="admin.php?page=cbrobot-queues" id="cbrobot_create_queue" class="cmxform">	
						<p class="submit"><input class="button-primary" type="submit" name="cbrobot_create_queue_save" value="<?php _e("Create Queue","cbrobot") ?>" /></p>
						<h3 style="text-transform:uppercase;border-bottom: 1px solid #ccc;"><?php _e("Blogger Options","cbrobot") ?></h3>	
						<table class="addt" width="100%" cellspacing="2" cellpadding="5" class="editform"> 		
								<tr valign="top"> 
										<td width="20%" scope="row"><?php _e("Blogger ID :","cbrobot") ?></td>
										<td><input size="50" name="cbrobot_bg_id" type="text" id="cbrobot_bg_id" value="<?php echo $options['cbrobot_bg_id']; ?>" class="required" /></td> 
								</tr>
								<tr valign="top"> 
										<td width="20%" scope="row"><?php _e("Email :","cbrobot") ?></td>
										<td><input size="50" name="cbrobot_bg_email" type="text" id="cbrobot_bg_email" class="required" /></td> 
								</tr>
								<tr valign="top"> 
										<td width="20%" scope="row"><?php _e("Password :","cbrobot") ?></td>
										<td><input size="50" name="cbrobot_bg_password" type="password" id="cbrobot_bg_password" class="required" /></td> 
								</tr>
								<tr valign="top"> 
										<td width="20%" scope="row"><?php _e("Blogger URL :","cbrobot") ?></td>
										<td><input size="50" name="cbrobot_bg_url" type="text" id="cbrobot_bg_url" class="required" /></td> 
								</tr>
						</table>
						<h3 style="text-transform:uppercase;border-bottom: 1px solid #ccc;"><?php _e("Amazon Options","cbrobot") ?></h3>
						<table class="addt" width="100%" cellspacing="2" cellpadding="5" class="editform"> 		
								<tr valign="top"> 
										<td width="20%"><?php _e("Asin :","cbrobot") ?></td>
										<td><input size="30" name="cbrobot_aa_asin" type="text" id="cbrobot_aa_asin" /></td> 
										<td>&nbsp;</td>
								</tr>
		
						</table>
				</form>
		</div>
	
		<?php 
			$sql = "SELECT * 
			        FROM " . $wpdb->prefix."cbrobot_queues 
					WHERE queue_status <> 'Y'
					ORDER BY id DESC
					LIMIT 0,30 ";
			
			$records = $wpdb->get_results($sql); 

			if ($records) {
		?>
		<h3 style="text-transform:uppercase;border-bottom: 1px solid #ccc;"><?php _e("All Queue ","wpcrobot") ?></h3>
		<table class="widefat post fixed" cellspacing="0">	
		<thead>
			<tr>
				<th id="id" class="manage-column column-id" style="" scope="col"><?php _e("Queue Id","cbrobot") ?></th>
				<th id="url" class="manage-column column-url" style="" scope="col"><?php _e("Blog URL","cbrobot") ?></th>
				<th id="asin" class="manage-column column-asin" style="" scope="col"><?php _e("Asin","cbrobot") ?></th>
				<th id="time" class="manage-column column-time" style="" scope="col"><?php _e("Queue Create","cbrobot") ?></th>
				<th id="post" class="manage-column column-post" style="" width="50px" scope="col"><?php _e("Post","cbrobot") ?></th>
				<th id="delete" class="manage-column column-delete" style="" width="50px" scope="col"><?php _e("Delete","cbrobot") ?></th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<th class="manage-column column-id" style="" scope="col"><?php _e("Queue Id","cbrobot") ?></th>
				<th class="manage-column column-url" style="" scope="col"><?php _e("Blog URL","cbrobot") ?></th>
				<th class="manage-column column-asin" style="" scope="col"><?php _e("Asin","cbrobot") ?></th>
				<th class="manage-column column-time" style="" scope="col"><?php _e("Queue Create","cbrobot") ?></th>
				<th class="manage-column column-post" style="" width="50px" scope="col"><?php _e("Post","cbrobot") ?></th>
				<th class="manage-column column-delete" style="" scope="col"><?php _e("Delete","cbrobot") ?></th>
			</tr>
		</tfoot>	
		<tbody>	
		<?php foreach ($records as $record) { ?>
			<tr class="alternate author-self status-publish iedit" valign="top" style="background:#EFFBFB;">		
				<td><?php echo $record->id; ?></td>
				<td><?php echo $record->blog_url; ?></td>
				<td><?php echo $record->asin; ?></td>	
				<td><?php echo date('Y-m-d h:j:s',$record->queue_time); ?></td>
				<td><a href="admin.php?page=cbrobot-queues&postdata=<?php echo $record->id; ?>">Post</a></td>
				<td><a href="admin.php?page=cbrobot-queues&delete=<?php echo $record->id; ?>">Delete</a></td>
			</tr>
		<?php }//end foreach ?>
		</table>
		<strong>Total : <?php echo count($records); ?> Record</strong>
		<?php }//endif ?>

</div>
<!--- End wrap--->